// Copyright (C) 2016 The V8 Project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-number.isfinite
description: >
  Return false if argument is not Number
info: |
  Number.isFinite ( number )

  1. If Type(number) is not Number, return false.
  [...]
features: [Symbol]
---*/

function Test() {
    assert.sameValue(Number.isFinite("1"), false, "string");
    assert.sameValue(Number.isFinite([1]), false, "[1]");
    assert.sameValue(Number.isFinite(new Number(42)), false, "Number object");
    assert.sameValue(Number.isFinite(false), false, "false");
    assert.sameValue(Number.isFinite(true), false, "true");
    assert.sameValue(Number.isFinite(undefined), false, "undefined");
    assert.sameValue(Number.isFinite(null), false, "null");
    assert.sameValue(Number.isFinite(Symbol("1")), false, "symbol");
    assert.sameValue(Number.isFinite(), false, "no arg");
}

// preheat
const NUMBER_OF_PREHEAT = 1;
for (let i = 0; i < NUMBER_OF_PREHEAT; i++) {
    Test();
}

ArkTools.jitCompileAsync(Test);
assert.sameValue(ArkTools.waitJitCompileFinish(Test), true, '[JIT] JIT disabled.');

// test
const NUMBER_OF_TEST = 1; // or 2
for (let i = 0; i < NUMBER_OF_TEST; i++) {
    Test();
}
